package com.yxinsur.imc.business.enums;

import com.yxinsur.imc.common.utils.StringUtils;
import lombok.Getter;

/**
 * 缴费年期类型
 */
@Getter
public enum ChargeIntervalEnum {

	/**
	 * 年缴
	 */
	B(1,12),
	/**
	 * 月缴
	 */
	E(12,1),
	/**
	 * 半年交
	 */
	C(2,6),
	/**
	 * 季交
	 */
	D(4,3);

	private int payNum;	//一年缴费次数
	private int payMonth;//N个月缴费一次

	ChargeIntervalEnum(int payNum,int payMonth) {
		this.payNum = payNum;
		this.payMonth = payMonth;
	}

	public static ChargeIntervalEnum getByKName(String keyName){
		ChargeIntervalEnum enums = null;
		if(StringUtils.isNotBlank(keyName)){
			for (ChargeIntervalEnum c : ChargeIntervalEnum.values()) {
				if (c.name().equals(keyName)) {
					enums = c;
				}
			}
		}
		return enums;
	}
}
